/**
 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
 */

export const enum ErrorCode {
  // api module
  OK = 0,
  INTERNAL_ERROR = 1240001,
  CLOUDDBZONE_INIT_FAILED = 1240004,
  CLOUDDBZONE_DOES_NOT_EXIST = 1240005,
  CLOUDDBZONE_NUM_EXCEEDS_LIMIT = 1240006,
  CLOUDDBZONE_IS_BUSY = 1240007,
  CLOUDDBZONE_IS_OPENED = 1240008,
  CLOUDDBZONE_IS_CLOSED = 1240009,
  SUBSCRIBER_IS_REGISTERED = 1240010,
  QUERY_POLICY_IS_ILLEGAL = 1240011,
  SNAPSHOT_NUM_EXCEEDS_LIMIT = 1240013,
  SDK_VERSION_COLLAPSE = 1240014,
  LOCAL_PERMISSION_DENIED = 1240015,
  OBJECT_TYPE_NO_EXIST = 1240016,
  OBJECT_TYPE_INFO_IS_INVALID = 1240017,
  CLOUDDBCONFIG_INVALID = 1240018,
  NO_DATA_FOUND = 1240019,
  TRANSFER_UNFINISHED = 1240020,
  OBJECTTYPE_VERSION_NOT_ALLOW_DOWNGRADE = 1240021,
  USER_KEY_INVALID = 1240050,
  DATA_ENCRYPTION_KEY_INVALID = 1240051,
  ENCRYPT_FAILED = 1240052,
  DECRYPT_FAILED = 1240053,
  ENCRYPTION_SALT_EMPTY = 1240054,

  // sync module
  NETWORK_UNAVAILABLE = 1241000,
  SCHEMA_NEGOTIATING = 1241001,
  SCHEMA_NEGOTIATE_FAIL = 1241002,
  INPUT_PARAMETER_INVALID = 1241003,
  COMMUNICATOR_QUEUE_FULL = 1241004,
  COMMUNICATOR_UNINITIALIZED = 1241005,
  COMMUNICATOR_DATA_LENGTH_INVALID = 1241006,
  SYNC_TASK_NO_RESPONSE = 1241007,
  SYNC_REQUEST_GENERATE_FAIL = 1241008,
  SYNC_RESPONSE_PARSE_FAIL = 1241009,
  SYNC_RESPONSE_CONTENT_ILLEGAL = 1241010,
  GATE_COMM_OVER_TIME = 1241011,
  CLIENT_TOKEN_REQUEST_FAIL = 1241012,
  USER_INFO_REQUEST_ERROR = 1241013,
  INVALID_APP_CONTEXT = 1241014,

  // Cloud side response code.
  VERIFY_TOKEN_FAILED = 1000000,
  SYNC_PERMISSION_DENY = 1000001,
  PRODUCT_SUB_COUNT_OVER_LIMIT = 1001000,
  CLIENT_SUB_COUNT_OVER_LIMIT = 1001001,
  SUB_CONDITION_OVER_COUNT = 1001002,
  SUB_CONDITION_TYPE_NOT_SUPPORT = 1001003,
  SUB_FIELD_TYPE_NOT_SUPPORT = 1001004,
  SUB_FIELD_VALUE_LEN_OVER_LIMIT = 1001005,
  TRANSACTION_RECORD_COUNT_OVER_LIMIT = 1001006,
  INDEX_NOT_FOUND = 1001007,
  SUB_NOT_SUPPORT_OBJECT_TYPE = 1001008,
  SUB_SENSITIVE_FIELD_NOT_SUPPORT = 1001009,
  SYNC_INVALID_PARAM = 1002000,
  SYNC_INVALID_STORE = 1002001,
  SYNC_INVALID_FIELD = 1002002,
  SYNC_INVALID_FIELD_TYPE = 1002003,
  SYNC_INVALID_PRODUCT = 1002004,
  SYNC_INVALID_QUERY_CONDITION = 1002005,
  SUB_ADD_INTERNAL_ERROR = 1003000,
  ILLEGAL_STORE_QUERY_RETURN = 1003001,
  SYNC_MSG_SERIALIZATION_ERROR = 1003002,
  PRODUCT_ARREARS = 1004000,
  READ_QUOTA_INSUFFICIENT = 1004001,
  WRITE_QUOTA_INSUFFICIENT = 1004002,
  DELETE_QUOTA_INSUFFICIENT = 1004003,
  NETWORK_QUOTA_INSUFFICIENT = 1004004,
  STORAGE_QUOTA_INSUFFICIENT = 1004005,
  DB_WRITE_OVER_LIMIT = 1004006,
  OPS_OVER_LIMIT = 1004007,
  SYNC_THREAD_POOL_REJECTED = 1004008,
  USER_READ_QUOTA_OVER_LIMIT = 1004009,
  USER_UPSERT_QUOTA_OVER_LIMIT = 1004010,
  USER_DELET_QUOTA_OVER_LIMIT = 1004011,
  USER_OUT_BUFFER_QUOTA_OVER_LIMIT = 1004012,
  ENCRYPT_RECORD_EMPTY = 1005000,
  ENCRYPTION_VERSION_UNMATCHED = 1005001,
  ENCRYPT_RE_KEY_REJECT = 1005002,
  RE_KEY_STATUS_ERROR = 1005003,
  RE_KEY_MSG_ERROR = 1005004,
  INVALID_INPUT_SCHEMA = 1006000,
  INVALID_SCHEMA_NAME = 1006001,
  SCHEMA_FIELDS_COUNT_UNMATCHED = 1006002,
  SCHEMA_FIELDS_LOST = 1006003,
  SCHEMA_FIELDS_TYPE_UNMATCHED = 1006004,
  SCHEMA_FIELDS_NULL_TYPE_UNMATCHED = 1006005,
  SCHEMA_FIELDS_PRIMARY_KEY_UNMATCHED = 1006006,
  SCHEMA_FIELDS_DEFAULT_VALUE_UNMATCHED = 1006007,
  SCHEMA_FIELDS_ENCRYPT_UNMATCHED = 1006008,

  SYSTEM_ERROR = 2000000,
  OPERATION_ILLEGAL = 2001000,
  PRODUCT_STATUS_NON_CREATED = 2001001,
  DB_ZONE_EXCEED_LIMIT = 2001002,
  SCHEMA_DELETE_NOT_ALLOWED = 2001003,
  SCHEMA_MODIFY_NOT_ALLOWED_ON_IMPORT = 2001004,
  SCHEMA_COUNT_EXCEED_LIMIT = 2001005,
  PRIMARY_KEY_MODIFY_NOT_ALLOWED = 2001006,
  FIELD_MODIFY_NOT_ALLOWED = 2001007,
  FIELD_DELETE_NOT_ALLOWED = 2001008,
  FIELD_COUNT_EXCEED_LIMIT = 2001009,
  INDEX_MODIFY_NOT_ALLOWED = 2001010,
  INDEX_DELETE_NOT_ALLOWED = 2001011,
  INDEX_COUNT_EXCEED_LIMIT = 2001012,
  INDEX_FIELD_COUNT_EXCEED_LIMIT = 2001013,
  PERMISSION_NOT_FOUND = 2001014,
  PERMISSION_DENIED = 2001015,
  QUERY_ENCRYPTED_FIELD_UNSUPPORTED = 2001016,
  QUERY_RESULT_SIZE_EXCEED_LIMIT = 2001017,
  QUERY_RESULT_COUNT_EXCEED_LIMIT = 2001018,
  WRITE_PROHIBITED = 2001019,
  WRITE_VALUE_SIZE_EXCEED_LIMIT = 2001020,
  WRITE_STRING_VALUE_SIZE_EXCEED_LIMIT = 2001021,
  ENCRYPTION_USER_NOT_FOUND = 2001022,
  ENCRYPTION_USER_DUPLICATE = 2001023,
  ENCRYPTION_FAILURE_OVER_TIMES = 2001024,
  ENCRYPTION_TOKEN_UNMATCHED = 2001025,
  ENCRYPTION_OPERATION_DENIED_STATUS_ABNORMAL = 2001026,
  ENCRYPTION_OPERATION_DENIED_STATUS_UPDATING = 2001027,
  FIELD_STRING_COUNT_EXCEED_LIMIT = 2001028,
  READ_PROHIBITED = 2001040,
  QUERY_SENSITIVE_FIELD_UNSUPPORTED = 2001041,
  PARAM_INVALID = 2002000,
  PRODUCT_ID_INVALID = 2002001,
  PRODUCT_TYPE_INVALID = 2002002,
  STORE_ID_INVALID = 2002003,
  SCHEMA_OPERATION_UNSUPPORTED = 2002004,
  SCHEMA_ORIGINAL_CHANGED = 2002005,
  SCHEMA_EXISTED = 2002006,
  SCHEMA_NOT_EXIST = 2002007,
  SCHEMA_DUPLICATE = 2002008,
  SCHEMA_NAME_INVALID = 2002009,
  SCHEMA_NO_FIELD = 2002010,
  SCHEMA_INVALID = 2002011,
  FIELD_DUPLICATE = 2002012,
  FIELD_NAME_INVALID = 2002013,
  FIELD_TYPE_INVALID = 2002014,
  FIELD_VALUE_INVALID = 2002015,
  ENCRYPTED_FIELD_VALUE_TYPE_ERROR = 2002016,
  INDEX_NAME_INVALID = 2002017,
  INDEX_DUPLICATE = 2002018,
  INDEX_FIELD_NOT_EXIST = 2002019,
  ROLE_TYPE_INVALID = 2002020,
  CURSOR_INDEX_INVALID = 2002021,
  CACHE_CHANGE_MESSAGE_INVALID = 2002022,
  USER_INPUT_INVALID = 2002023,
  DEFAULT_VALUE_ABSENT = 2002024,
  PRIMARY_KEY_NOT_SET_NOT_NULL = 2002025,
  PRIMARY_KEY_NOT_SUPPORT_DEFAULT_VALUE = 2002026,
  PRIMARY_KEY_NOT_SUPPORT_ENCRYPTED = 2002027,
  PRIMARY_KEY_NOT_SUPPORT_CURRENT_TYPE = 2002028,
  PRIMARY_KEY_ABSENT = 2002029,
  PRIMARY_KEY_NUMBER_EXCEED = 2002030,
  FILED_TYPE_NOT_SUPPORT_NOT_NULL = 2002031,
  FILED_TYPE_NOT_SUPPORT_DEFAULT_VALUE = 2002032,
  FILED_TYPE_NOT_SUPPORT_ENCRYPT = 2002033,
  SCHEMA_CONCURRENT_MODIFY_ERROR = 2002034,
  DEFAULT_VALUE_MUST_NOT_NULL = 2002035,
  NOT_NULL_FIELD_IS_NULL = 2002036,
  DB_ZONE_NOT_EXIST = 2002037,
  PRIMARY_KEY_NOT_SUPPORT_SENSITIVE = 2002046,
  FIELD_TYPE_NOT_SUPPORT_SENSITIVE = 2002047,
  INDEX_CONTAINS_SENSITIVE_FIELD = 2002048,
  SENSITIVE_FIELD_NOT_SUPPORT_INCREMENT = 2002049,
  SCHEMA_WITH_SENSITIVE_FIELD_UNSUPPORTED_THIS_OPERATION = 2002050,
  RUNTIME_ERROR = 2003000,
  STORAGE_USAGE_GET_ERROR = 2003001,
  STORAGE_SIZE_GET_ERROR = 2003002,
  APP_CREATE_ERROR = 2003003,
  APP_DELETE_ERROR = 2003004,
  DATABASE_CREATE_ERROR = 2003005,
  DATABASE_CHECK_EXIST_ERROR = 2003006,
  NODE_GROUP_OCCUPY_ERROR = 2003007,
  NODE_GROUP_FREE_ERROR = 2003008,
  PGXC_NODE_QUERY_ERROR = 2003009,
  PRODUCT_TO_NODE_GROUP_QUERY_ERROR = 2003010,
  CLUSTER_INFO_QUERY_ALL_ERROR = 2003011,
  CLUSTER_GET_AVAILABLE_ERROR = 2003012,
  CLUSTER_OCCUPY_ERROR = 2003013,
  CLUSTER_QUERY_ERROR = 2003014,
  DB_MAPPER_CONFIG_INSERT_ERROR = 2003015,
  DB_ZONE_CHECK_EXIST_ERROR = 2003016,
  DB_ZONE_CREATE_ERROR = 2003017,
  DB_ZONE_DROP_ERROR = 2003018,
  SYSTEM_TABLE_INIT_ERROR = 2003019,
  SCHEMA_UPGRADE_ERROR = 2003020,
  SCHEMA_VERSION_GENERATE_ERROR = 2003021,
  SCHEMA_PERMISSION_SET_ERROR = 2003022,
  FIELD_TYPE_ERROR = 2003023,
  TABLE_CREATE_ERROR = 2003024,
  TABLE_UPGRADE_ERROR = 2003025,
  TABLE_DROP_ERROR = 2003026,
  TABLE_CHECK_EXIST_ERROR = 2003027,
  TABLE_LOCK_ERROR = 2003028,
  PRODUCT_MAPPING_QUERY_ERROR = 2003029,
  PRODUCT_MAPPING_UPSERT_ERROR = 2003030,
  PRODUCT_MAPPING_DELETE_ERROR = 2003031,
  PRODUCT_KEY_QUERY_ERROR = 2003032,
  PRODUCT_KEY_INSERT_ERROR = 2003033,
  PRODUCT_KEY_DELETE_ERROR = 2003034,
  PRODUCT_STATUS_QUERY_ERROR = 2003035,
  PRODUCT_STATUS_UPDATE_ERROR = 2003036,
  PRODUCT_INFO_QUERY_ALL_ERROR = 2003037,
  PRODUCT_INFO_PERSIST_ERROR = 2003038,
  PRODUCT_INFO_DELETE_ERROR = 2003039,
  PRODUCT_DB_ID_QUERY_ERROR = 2003040,
  PRODUCT_ID_QUERY_ALL_ERROR = 2003041,
  ID_GENERATE_ERROR = 2003042,
  ID_LOCK_ERROR = 2003043,
  ID_VALUE_TYPE_ERROR = 2003044,
  ID_UPDATE_ERROR = 2003045,
  COUNTER_INIT_ERROR = 2003046,
  COUNTER_QUERY_ERROR = 2003047,
  COUNTER_UPDATE_ERROR = 2003048,
  CACHED_PLAN_CHANGED = 2003049,
  PREPARED_STATEMENT_INVALID = 2003050,
  BIND_VALUE_ERROR = 2003051,
  VALUE_CONVERT_ERROR = 2003052,
  NUMERIC_VALUE_OUT_OF_RANGE_ERROR = 2003053,
  DB_CONNECTION_GET_ERROR = 2003054,
  DB_CONNECTION_INIT_ERROR = 2003055,
  DB_CONNECTION_INVALID = 2003056,
  DB_GROUP_ID_NOT_FOUND = 2003057,
  USE_DATABASE_ERROR = 2003058,
  DB_MAPPER_CONFIG_VERIFY_ERROR = 2003059,
  CONFIG_IN_DB_GET_ERROR = 2003060,
  CONFIG_IN_DB_MODIFY_ERROR = 2003061,
  CONFIG_IN_DB_ITEM_NOT_EXIST = 2003062,
  TRANSACTION_EXECUTE_ERROR = 2003063,
  TRANSACTION_START_ERROR = 2003064,
  TRANSACTION_COMMIT_ERROR = 2003065,
  TRANSACTION_ROLLBACK_ERROR = 2003066,
  SQL_EXECUTE_ERROR = 2003067,
  QUERY_ERROR = 2003068,
  INSERT_ERROR = 2003069,
  UPDATE_ERROR = 2003070,
  DELETE_ERROR = 2003071,
  TRUNCATE_ERROR = 2003072,
  UPSERT_ERROR = 2003073,
  BATCH_UPSERT_ERROR = 2003074,
  BATCH_DELETE_ERROR = 2003075,
  RECORD_QUERY_ERROR = 2003076,
  RECORD_UPSERT_ERROR = 2003077,
  RECORD_DELETE_ERROR = 2003078,
  RECORD_TRUNCATE_ERROR = 2003079,
  RESULT_SET_EXTRACT_ERROR = 2003080,
  VALUE_EXTRACT_ERROR = 2003081,
  OBJECT_VERSION_GET_ERROR = 2003082,
  EXPECTED_VALUE_NOT_FOUND = 2003083,
  DB_CONN_LIMIT_ALTER_ERROR = 2003084,
  UNSUPPORTED_ERROR = 2003085,
  SCHEMA_QUERY_ERROR = 2003086,
  SCHEMA_CONVERT_ERROR = 2003087,
  INSTANCE_ID_GET_ERROR = 2003088,
  PRODUCT_MAPPING_NOT_FOUND = 2003089,
  CLUSTER_NO_FREE = 2003090,
  GROUP_NOT_EMPTY = 2003091,
  NODE_GROUP_NO_FREE = 2003092,
  NODE_GROUP_NOT_ALLOCATED = 2003093,
  INDEX_FIELD_VALUE_LENGTH_EXCEED = 2003094,
  PRODUCT_INFO_QUERY_ERROR = 2003095,
  GENERATE_PRODUCT_SEQUENCE_ERROR = 2003096,
  VIOLATES_UNIQUE_CONSTRAINT = 2003097
}
